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

Side by Side Diff: third_party/WebKit/Source/core/fileapi/FileReader.cpp

Issue 1929493002: Remove unnecessary uses of GarbageCollectedFinalized<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add two leftover classes needing same treatment Created 4 years, 7 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 } // namespace 64 } // namespace
65 65
66 // Embedders like chromium limit the number of simultaneous requests to avoid 66 // Embedders like chromium limit the number of simultaneous requests to avoid
67 // excessive IPC congestion. We limit this to 100 per thread to throttle the 67 // excessive IPC congestion. We limit this to 100 per thread to throttle the
68 // requests (the value is arbitrarily chosen). 68 // requests (the value is arbitrarily chosen).
69 static const size_t kMaxOutstandingRequestsPerThread = 100; 69 static const size_t kMaxOutstandingRequestsPerThread = 100;
70 static const double progressNotificationIntervalMS = 50; 70 static const double progressNotificationIntervalMS = 50;
71 71
72 class FileReader::ThrottlingController final : public GarbageCollectedFinalized< FileReader::ThrottlingController>, public Supplement<ExecutionContext> { 72 class FileReader::ThrottlingController final : public GarbageCollected<FileReade r::ThrottlingController>, public Supplement<ExecutionContext> {
73 USING_GARBAGE_COLLECTED_MIXIN(FileReader::ThrottlingController); 73 USING_GARBAGE_COLLECTED_MIXIN(FileReader::ThrottlingController);
74 public: 74 public:
75 static ThrottlingController* from(ExecutionContext* context) 75 static ThrottlingController* from(ExecutionContext* context)
76 { 76 {
77 if (!context) 77 if (!context)
78 return 0; 78 return 0;
79 79
80 ThrottlingController* controller = static_cast<ThrottlingController*>(Su pplement<ExecutionContext>::from(*context, supplementName())); 80 ThrottlingController* controller = static_cast<ThrottlingController*>(Su pplement<ExecutionContext>::from(*context, supplementName()));
81 if (!controller) { 81 if (!controller) {
82 controller = new ThrottlingController; 82 controller = new ThrottlingController;
83 provideTo(*context, supplementName(), controller); 83 provideTo(*context, supplementName(), controller);
84 } 84 }
85 return controller; 85 return controller;
86 } 86 }
87 87
88 ~ThrottlingController() { }
89
90 enum FinishReaderType { DoNotRunPendingReaders, RunPendingReaders }; 88 enum FinishReaderType { DoNotRunPendingReaders, RunPendingReaders };
91 89
92 static void pushReader(ExecutionContext* context, FileReader* reader) 90 static void pushReader(ExecutionContext* context, FileReader* reader)
93 { 91 {
94 ThrottlingController* controller = from(context); 92 ThrottlingController* controller = from(context);
95 if (!controller) 93 if (!controller)
96 return; 94 return;
97 95
98 InspectorInstrumentation::asyncTaskScheduled(context, "FileReader", read er, true); 96 InspectorInstrumentation::asyncTaskScheduled(context, "FileReader", read er, true);
99 controller->pushReader(reader); 97 controller->pushReader(reader);
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 } 458 }
461 459
462 DEFINE_TRACE(FileReader) 460 DEFINE_TRACE(FileReader)
463 { 461 {
464 visitor->trace(m_error); 462 visitor->trace(m_error);
465 EventTargetWithInlineData::trace(visitor); 463 EventTargetWithInlineData::trace(visitor);
466 ActiveDOMObject::trace(visitor); 464 ActiveDOMObject::trace(visitor);
467 } 465 }
468 466
469 } // namespace blink 467 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCache.h ('k') | third_party/WebKit/Source/core/html/ValidityState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698