| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "bindings/core/dart/DartScriptState.h" | 32 #include "bindings/core/dart/DartScriptState.h" |
| 33 | 33 |
| 34 #include "bindings/core/dart/DartScriptPromise.h" | 34 #include "bindings/core/dart/DartScriptPromise.h" |
| 35 #include "bindings/core/dart/DartScriptPromiseResolver.h" | 35 #include "bindings/core/dart/DartScriptPromiseResolver.h" |
| 36 #include "bindings/core/dart/DartUtilities.h" | 36 #include "bindings/core/dart/DartUtilities.h" |
| 37 #include "platform/SharedBuffer.h" | 37 #include "platform/SharedBuffer.h" |
| 38 #include <dart_debugger_api.h> | 38 #include <dart_debugger_api.h> |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 DartScriptState::DartScriptState(Dart_Isolate isolate, intptr_t libraryId, V8Scr
iptState* v8ScriptState) | 42 DartScriptState::DartScriptState(Dart_Isolate isolate, intptr_t libraryId, V8Scr
iptState* v8ScriptState, const String& isolateName) |
| 43 { | 43 { |
| 44 m_isolate = isolate; | 44 m_isolate = isolate; |
| 45 m_libraryId = libraryId; | 45 m_libraryId = libraryId; |
| 46 m_libraryUrl = DartUtilities::toString(Dart_GetLibraryURL(libraryId)); | 46 String libraryUrl = DartUtilities::toString(Dart_GetLibraryURL(libraryId)); |
| 47 if (!isolateName.isEmpty()) { |
| 48 m_name = String::format("%s - %s", isolateName.utf8().data(), libraryUrl
.utf8().data()); |
| 49 } else { |
| 50 m_name = libraryUrl; |
| 51 } |
| 47 m_v8ScriptState = v8ScriptState; | 52 m_v8ScriptState = v8ScriptState; |
| 48 } | 53 } |
| 49 | 54 |
| 50 bool DartScriptState::contextIsValid() const | 55 bool DartScriptState::contextIsValid() const |
| 51 { | 56 { |
| 52 if (m_v8ScriptState) | 57 if (m_v8ScriptState) |
| 53 return m_v8ScriptState->contextIsValid(); | 58 return m_v8ScriptState->contextIsValid(); |
| 54 return true; | 59 return true; |
| 55 } | 60 } |
| 56 | 61 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 129 |
| 125 #ifndef NDEBUG | 130 #ifndef NDEBUG |
| 126 void DartScriptState::assertPrimaryKeyValidOrInjectable(PassRefPtr<SharedBuffer>
buffer, const Vector<blink::WebBlobInfo>* blobInfo, IDBKey* key, const IDBKeyPa
th& keyPath) | 131 void DartScriptState::assertPrimaryKeyValidOrInjectable(PassRefPtr<SharedBuffer>
buffer, const Vector<blink::WebBlobInfo>* blobInfo, IDBKey* key, const IDBKeyPa
th& keyPath) |
| 127 { | 132 { |
| 128 // FIXMEDART: Implement without Dart<->V8 conversion. | 133 // FIXMEDART: Implement without Dart<->V8 conversion. |
| 129 return v8ScriptState()->assertPrimaryKeyValidOrInjectable(buffer, blobInfo,
key, keyPath); | 134 return v8ScriptState()->assertPrimaryKeyValidOrInjectable(buffer, blobInfo,
key, keyPath); |
| 130 } | 135 } |
| 131 #endif | 136 #endif |
| 132 | 137 |
| 133 } // namespace blink | 138 } // namespace blink |
| OLD | NEW |