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

Side by Side Diff: Source/core/workers/SharedWorker.cpp

Issue 177073004: Oilpan: move core/workers to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "platform/weborigin/SecurityOrigin.h" 47 #include "platform/weborigin/SecurityOrigin.h"
48 48
49 namespace WebCore { 49 namespace WebCore {
50 50
51 inline SharedWorker::SharedWorker(ExecutionContext* context) 51 inline SharedWorker::SharedWorker(ExecutionContext* context)
52 : AbstractWorker(context) 52 : AbstractWorker(context)
53 { 53 {
54 ScriptWrappable::init(this); 54 ScriptWrappable::init(this);
55 } 55 }
56 56
57 PassRefPtr<SharedWorker> SharedWorker::create(ExecutionContext* context, const S tring& url, const String& name, ExceptionState& exceptionState) 57 PassRefPtrWillBeRawPtr<SharedWorker> SharedWorker::create(ExecutionContext* cont ext, const String& url, const String& name, ExceptionState& exceptionState)
58 { 58 {
59 ASSERT(isMainThread()); 59 ASSERT(isMainThread());
60 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); 60 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument());
61 61
62 UseCounter::count(context, UseCounter::SharedWorkerStart); 62 UseCounter::count(context, UseCounter::SharedWorkerStart);
63 63
64 RefPtr<SharedWorker> worker = adoptRef(new SharedWorker(context)); 64 RefPtrWillBeRawPtr<SharedWorker> worker = adoptRefCountedWillBeRefCountedGar bageCollected(new SharedWorker(context));
65 65
66 RefPtr<MessageChannel> channel = MessageChannel::create(context); 66 RefPtrWillBeRawPtr<MessageChannel> channel = MessageChannel::create(context) ;
67 worker->m_port = channel->port1(); 67 worker->m_port = channel->port1();
68 OwnPtr<blink::WebMessagePortChannel> remotePort = channel->port2()->disentan gle(); 68 OwnPtr<blink::WebMessagePortChannel> remotePort = channel->port2()->disentan gle();
69 ASSERT(remotePort); 69 ASSERT(remotePort);
70 70
71 worker->suspendIfNeeded(); 71 worker->suspendIfNeeded();
72 72
73 // We don't currently support nested workers, so workers can only be created from documents. 73 // We don't currently support nested workers, so workers can only be created from documents.
74 Document* document = toDocument(context); 74 Document* document = toDocument(context);
75 if (!document->securityOrigin()->canAccessSharedWorkers()) { 75 if (!document->securityOrigin()->canAccessSharedWorkers()) {
76 exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->securityOrigin()->toString() + "'."); 76 exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->securityOrigin()->toString() + "'.");
(...skipping 22 matching lines...) Expand all
99 void SharedWorker::setPreventGC() 99 void SharedWorker::setPreventGC()
100 { 100 {
101 setPendingActivity(this); 101 setPendingActivity(this);
102 } 102 }
103 103
104 void SharedWorker::unsetPreventGC() 104 void SharedWorker::unsetPreventGC()
105 { 105 {
106 unsetPendingActivity(this); 106 unsetPendingActivity(this);
107 } 107 }
108 108
109 void SharedWorker::trace(Visitor* visitor)
110 {
111 visitor->trace(m_port);
112 }
113
109 } // namespace WebCore 114 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698