org.chromium.sdk/src/org/chromium/sdk/UpdatableScript.java
changeset 355 8726e95bcbba
equal deleted inserted replaced
354:0bceeb415e7f 355:8726e95bcbba
       
     1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
       
     2 // Use of this source code is governed by a BSD-style license that can be
       
     3 // found in the LICENSE file.
       
     4 
       
     5 package org.chromium.sdk;
       
     6 
       
     7 /**
       
     8  * This interface is a part of {@link Script} interface. It extends {@link Script} in order
       
     9  * to support experimental feature and is under development.
       
    10  */
       
    11 public interface UpdatableScript extends Script {
       
    12   /**
       
    13    * Demands that script text should be replaced with a new one if possible.
       
    14    * @param newSource new text of script
       
    15    */
       
    16   void setSourceOnRemote(String newSource, UpdateCallback callback, SyncCallback syncCallback);
       
    17 
       
    18   interface UpdateCallback {
       
    19     /**
       
    20      * Script text has been successfully changed. {@link DebugEventListener#scriptChanged} will
       
    21      * be called additionally. Besides, a current context may be dismissed and recreated after this
       
    22      * event. The order of all listed event notifications is not currently specified.
       
    23      */
       
    24     void success(Object report);
       
    25     void failure(String message);
       
    26   }
       
    27 }