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

Side by Side Diff: third_party/WebKit/Source/web/WebKit.cpp

Issue 2887523003: Introduced WebFactory and WebFactoryImpl for constructing web/ classes (Closed)
Patch Set: Added TODOs for review feedback Created 3 years, 6 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 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "platform/heap/Heap.h" 46 #include "platform/heap/Heap.h"
47 #include "platform/wtf/Assertions.h" 47 #include "platform/wtf/Assertions.h"
48 #include "platform/wtf/PtrUtil.h" 48 #include "platform/wtf/PtrUtil.h"
49 #include "platform/wtf/WTF.h" 49 #include "platform/wtf/WTF.h"
50 #include "platform/wtf/allocator/Partitions.h" 50 #include "platform/wtf/allocator/Partitions.h"
51 #include "platform/wtf/text/AtomicString.h" 51 #include "platform/wtf/text/AtomicString.h"
52 #include "platform/wtf/text/TextEncoding.h" 52 #include "platform/wtf/text/TextEncoding.h"
53 #include "public/platform/Platform.h" 53 #include "public/platform/Platform.h"
54 #include "public/platform/WebThread.h" 54 #include "public/platform/WebThread.h"
55 #include "v8/include/v8.h" 55 #include "v8/include/v8.h"
56 #include "web/WebFactoryImpl.h"
56 57
57 namespace blink { 58 namespace blink {
58 59
59 namespace { 60 namespace {
60 61
61 class EndOfTaskRunner : public WebThread::TaskObserver { 62 class EndOfTaskRunner : public WebThread::TaskObserver {
62 public: 63 public:
63 void WillProcessTask() override { AnimationClock::NotifyTaskStart(); } 64 void WillProcessTask() override { AnimationClock::NotifyTaskStart(); }
64 void DidProcessTask() override { 65 void DidProcessTask() override {
65 Microtask::PerformCheckpoint(MainThreadIsolate()); 66 Microtask::PerformCheckpoint(MainThreadIsolate());
(...skipping 11 matching lines...) Expand all
77 return *initializer; 78 return *initializer;
78 } 79 }
79 80
80 void Initialize(Platform* platform) { 81 void Initialize(Platform* platform) {
81 Platform::Initialize(platform); 82 Platform::Initialize(platform);
82 83
83 V8Initializer::InitializeMainThread(); 84 V8Initializer::InitializeMainThread();
84 85
85 GetModulesInitializer().Initialize(); 86 GetModulesInitializer().Initialize();
86 87
88 WebFactory::SetInstance(*(new WebFactoryImpl()));
89
87 // currentThread is null if we are running on a thread without a message loop. 90 // currentThread is null if we are running on a thread without a message loop.
88 if (WebThread* current_thread = platform->CurrentThread()) { 91 if (WebThread* current_thread = platform->CurrentThread()) {
89 DCHECK(!g_end_of_task_runner); 92 DCHECK(!g_end_of_task_runner);
90 g_end_of_task_runner = new EndOfTaskRunner; 93 g_end_of_task_runner = new EndOfTaskRunner;
91 current_thread->AddTaskObserver(g_end_of_task_runner); 94 current_thread->AddTaskObserver(g_end_of_task_runner);
92 } 95 }
93 } 96 }
94 97
95 v8::Isolate* MainThreadIsolate() { 98 v8::Isolate* MainThreadIsolate() {
96 return V8PerIsolateData::MainThreadIsolate(); 99 return V8PerIsolateData::MainThreadIsolate();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void MemoryPressureNotificationToWorkerThreadIsolates( 135 void MemoryPressureNotificationToWorkerThreadIsolates(
133 v8::MemoryPressureLevel level) { 136 v8::MemoryPressureLevel level) {
134 WorkerBackingThread::MemoryPressureNotificationToWorkerThreadIsolates(level); 137 WorkerBackingThread::MemoryPressureNotificationToWorkerThreadIsolates(level);
135 } 138 }
136 139
137 void SetRAILModeOnWorkerThreadIsolates(v8::RAILMode rail_mode) { 140 void SetRAILModeOnWorkerThreadIsolates(v8::RAILMode rail_mode) {
138 WorkerBackingThread::SetRAILModeOnWorkerThreadIsolates(rail_mode); 141 WorkerBackingThread::SetRAILModeOnWorkerThreadIsolates(rail_mode);
139 } 142 }
140 143
141 } // namespace blink 144 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFactoryImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698