org.chromium.sdk/src/org/chromium/sdk/internal/ScriptManager.java
changeset 355 8726e95bcbba
parent 276 f2f4a1259de8
equal deleted inserted replaced
354:0bceeb415e7f 355:8726e95bcbba
    38    */
    38    */
    39   private final Map<Long, ScriptImpl> idToScript =
    39   private final Map<Long, ScriptImpl> idToScript =
    40       Collections.synchronizedMap(new HashMap<Long, ScriptImpl>());
    40       Collections.synchronizedMap(new HashMap<Long, ScriptImpl>());
    41 
    41 
    42   private final V8ContextFilter contextFilter;
    42   private final V8ContextFilter contextFilter;
       
    43   private final DebugSession debugSession;
    43 
    44 
    44   ScriptManager(V8ContextFilter contextFilter) {
    45   ScriptManager(V8ContextFilter contextFilter, DebugSession debugSession) {
    45     this.contextFilter = contextFilter;
    46     this.contextFilter = contextFilter;
       
    47     this.debugSession = debugSession;
    46   }
    48   }
    47 
    49 
    48   /**
    50   /**
    49    * Adds a script using a "script" V8 response.
    51    * Adds a script using a "script" V8 response.
    50    *
    52    *
    60     if (theScript == null) {
    62     if (theScript == null) {
    61       Descriptor desc = Descriptor.forResponse(scriptBody, refs, contextFilter);
    63       Descriptor desc = Descriptor.forResponse(scriptBody, refs, contextFilter);
    62       if (desc == null) {
    64       if (desc == null) {
    63         return null;
    65         return null;
    64       }
    66       }
    65       theScript = new ScriptImpl(desc);
    67       theScript = new ScriptImpl(desc, debugSession);
    66       idToScript.put(desc.id, theScript);
    68       idToScript.put(desc.id, theScript);
    67     }
    69     }
    68     if (scriptBody.source() != null) {
    70     if (scriptBody.source() != null) {
    69       setSourceCode(scriptBody, theScript);
    71       setSourceCode(scriptBody, theScript);
    70     }
    72     }