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

Side by Side Diff: third_party/WebKit/Source/core/loader/EmptyClients.cpp

Issue 2680843006: Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations. (Closed)
Patch Set: explain safety of HTMLTableSectionElement singletons Created 3 years, 10 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) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 29 matching lines...) Expand all
40 #include "public/platform/WebApplicationCacheHost.h" 40 #include "public/platform/WebApplicationCacheHost.h"
41 #include "public/platform/WebMediaPlayer.h" 41 #include "public/platform/WebMediaPlayer.h"
42 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" 42 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
43 #include "public/platform/modules/serviceworker/WebServiceWorkerProviderClient.h " 43 #include "public/platform/modules/serviceworker/WebServiceWorkerProviderClient.h "
44 #include "wtf/PtrUtil.h" 44 #include "wtf/PtrUtil.h"
45 #include <memory> 45 #include <memory>
46 46
47 namespace blink { 47 namespace blink {
48 48
49 void fillWithEmptyClients(Page::PageClients& pageClients) { 49 void fillWithEmptyClients(Page::PageClients& pageClients) {
50 // |ChromeClient| contains a weak reference to a |Node| (which derives
51 // from |ScriptWrappable|). That reference is only used for unit testing
52 // purposes and will not accidentally leak between contexts. Consequently,
53 // disable the singleton verification check.
50 DEFINE_STATIC_LOCAL(ChromeClient, dummyChromeClient, 54 DEFINE_STATIC_LOCAL(ChromeClient, dummyChromeClient,
51 (EmptyChromeClient::create())); 55 (EmptyChromeClient::create()), CheckScriptWrappable::No);
52 pageClients.chromeClient = &dummyChromeClient; 56 pageClients.chromeClient = &dummyChromeClient;
53 57
54 DEFINE_STATIC_LOCAL(EmptyContextMenuClient, dummyContextMenuClient, ()); 58 DEFINE_STATIC_LOCAL(EmptyContextMenuClient, dummyContextMenuClient, ());
55 pageClients.contextMenuClient = &dummyContextMenuClient; 59 pageClients.contextMenuClient = &dummyContextMenuClient;
56 60
57 DEFINE_STATIC_LOCAL(EmptyEditorClient, dummyEditorClient, ()); 61 DEFINE_STATIC_LOCAL(EmptyEditorClient, dummyEditorClient, ());
58 pageClients.editorClient = &dummyEditorClient; 62 pageClients.editorClient = &dummyEditorClient;
59 63
60 DEFINE_STATIC_LOCAL(EmptySpellCheckerClient, dummySpellCheckerClient, ()); 64 DEFINE_STATIC_LOCAL(EmptySpellCheckerClient, dummySpellCheckerClient, ());
61 pageClients.spellCheckerClient = &dummySpellCheckerClient; 65 pageClients.spellCheckerClient = &dummySpellCheckerClient;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 196
193 std::unique_ptr<WebApplicationCacheHost> 197 std::unique_ptr<WebApplicationCacheHost>
194 EmptyFrameLoaderClient::createApplicationCacheHost( 198 EmptyFrameLoaderClient::createApplicationCacheHost(
195 WebApplicationCacheHostClient*) { 199 WebApplicationCacheHostClient*) {
196 return nullptr; 200 return nullptr;
197 } 201 }
198 202
199 EmptyRemoteFrameClient::EmptyRemoteFrameClient() = default; 203 EmptyRemoteFrameClient::EmptyRemoteFrameClient() = default;
200 204
201 } // namespace blink 205 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698