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: content/renderer/render_frame_impl.cc

Issue 2648423006: Fix ExhaustMemory on clang. (Closed)
Patch Set: add comment, fix issue 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // as a browser initiated event. Instead, we want it to look as if the page 419 // as a browser initiated event. Instead, we want it to look as if the page
420 // initiated any load resulting from JS execution. 420 // initiated any load resulting from JS execution.
421 return pending && 421 return pending &&
422 !pending->common_params.url.SchemeIs(url::kJavaScriptScheme); 422 !pending->common_params.url.SchemeIs(url::kJavaScriptScheme);
423 } 423 }
424 424
425 NOINLINE void ExhaustMemory() { 425 NOINLINE void ExhaustMemory() {
426 volatile void* ptr = nullptr; 426 volatile void* ptr = nullptr;
427 do { 427 do {
428 ptr = malloc(0x10000000); 428 ptr = malloc(0x10000000);
429 base::debug::Alias(&ptr);
429 } while (ptr); 430 } while (ptr);
430 } 431 }
431 432
432 NOINLINE void CrashIntentionally() { 433 NOINLINE void CrashIntentionally() {
433 // NOTE(shess): Crash directly rather than using NOTREACHED() so 434 // NOTE(shess): Crash directly rather than using NOTREACHED() so
434 // that the signature is easier to triage in crash reports. 435 // that the signature is easier to triage in crash reports.
435 // 436 //
436 // Linker's ICF feature may merge this function with other functions with the 437 // Linker's ICF feature may merge this function with other functions with the
437 // same definition and it may confuse the crash report processing system. 438 // same definition and it may confuse the crash report processing system.
438 static int static_variable_to_make_this_function_unique = 0; 439 static int static_variable_to_make_this_function_unique = 0;
(...skipping 6375 matching lines...) Expand 10 before | Expand all | Expand 10 after
6814 // event target. Potentially a Pepper plugin will receive the event. 6815 // event target. Potentially a Pepper plugin will receive the event.
6815 // In order to tell whether a plugin gets the last mouse event and which it 6816 // In order to tell whether a plugin gets the last mouse event and which it
6816 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6817 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6817 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6818 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6818 // |pepper_last_mouse_event_target_|. 6819 // |pepper_last_mouse_event_target_|.
6819 pepper_last_mouse_event_target_ = nullptr; 6820 pepper_last_mouse_event_target_ = nullptr;
6820 #endif 6821 #endif
6821 } 6822 }
6822 6823
6823 } // namespace content 6824 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698