Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp

Issue 1830883002: Add blink::ServiceRegistry and expose it from LocalFrame and Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 18 matching lines...) Expand all
29 #include "bindings/core/v8/ScriptSourceCode.h" 29 #include "bindings/core/v8/ScriptSourceCode.h"
30 #include "bindings/core/v8/V8Binding.h" 30 #include "bindings/core/v8/V8Binding.h"
31 #include "bindings/core/v8/V8HiddenValue.h" 31 #include "bindings/core/v8/V8HiddenValue.h"
32 #include "bindings/core/v8/V8ObjectConstructor.h" 32 #include "bindings/core/v8/V8ObjectConstructor.h"
33 #include "bindings/core/v8/V8ScriptRunner.h" 33 #include "bindings/core/v8/V8ScriptRunner.h"
34 #include "core/frame/Deprecation.h" 34 #include "core/frame/Deprecation.h"
35 #include "core/inspector/MainThreadDebugger.h" 35 #include "core/inspector/MainThreadDebugger.h"
36 #include "platform/ScriptForbiddenScope.h" 36 #include "platform/ScriptForbiddenScope.h"
37 #include "public/platform/Platform.h" 37 #include "public/platform/Platform.h"
38 #include "wtf/LeakAnnotations.h" 38 #include "wtf/LeakAnnotations.h"
39 #include <memory>
39 40
40 namespace blink { 41 namespace blink {
41 42
42 static V8PerIsolateData* mainThreadPerIsolateData = 0; 43 static V8PerIsolateData* mainThreadPerIsolateData = 0;
43 44
44 static void beforeCallEnteredCallback(v8::Isolate* isolate) 45 static void beforeCallEnteredCallback(v8::Isolate* isolate)
45 { 46 {
46 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden()); 47 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
47 } 48 }
48 49
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 v8::Isolate* V8PerIsolateData::initialize() 160 v8::Isolate* V8PerIsolateData::initialize()
160 { 161 {
161 V8PerIsolateData* data = new V8PerIsolateData(); 162 V8PerIsolateData* data = new V8PerIsolateData();
162 v8::Isolate* isolate = data->isolate(); 163 v8::Isolate* isolate = data->isolate();
163 isolate->SetData(gin::kEmbedderBlink, data); 164 isolate->SetData(gin::kEmbedderBlink, data);
164 return isolate; 165 return isolate;
165 } 166 }
166 167
167 void V8PerIsolateData::enableIdleTasks(v8::Isolate* isolate, PassOwnPtr<gin::V8I dleTaskRunner> taskRunner) 168 void V8PerIsolateData::enableIdleTasks(v8::Isolate* isolate, PassOwnPtr<gin::V8I dleTaskRunner> taskRunner)
168 { 169 {
169 from(isolate)->m_isolateHolder->EnableIdleTasks(scoped_ptr<gin::V8IdleTaskRu nner>(taskRunner.leakPtr())); 170 from(isolate)->m_isolateHolder->EnableIdleTasks(std::unique_ptr<gin::V8IdleT askRunner>(taskRunner.leakPtr()));
170 } 171 }
171 172
172 v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot() 173 v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot()
173 { 174 {
174 if (m_liveRoot.isEmpty()) 175 if (m_liveRoot.isEmpty())
175 m_liveRoot.set(isolate(), v8::Null(isolate())); 176 m_liveRoot.set(isolate(), v8::Null(isolate()));
176 return m_liveRoot.getUnsafe(); 177 return m_liveRoot.getUnsafe();
177 } 178 }
178 179
179 // willBeDestroyed() clear things that should be cleared before 180 // willBeDestroyed() clear things that should be cleared before
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 ASSERT(!m_threadDebugger); 322 ASSERT(!m_threadDebugger);
322 m_threadDebugger = std::move(threadDebugger); 323 m_threadDebugger = std::move(threadDebugger);
323 } 324 }
324 325
325 ThreadDebugger* V8PerIsolateData::threadDebugger() 326 ThreadDebugger* V8PerIsolateData::threadDebugger()
326 { 327 {
327 return m_threadDebugger.get(); 328 return m_threadDebugger.get();
328 } 329 }
329 330
330 } // namespace blink 331 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.cc ('k') | third_party/WebKit/Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698