Changeset 260347 in webkit


Ignore:
Timestamp:
Apr 19, 2020 7:18:32 PM (4 years ago)
Author:
ddkilzer@apple.com
Message:

[IPC hardening] Use MESSAGE_CHECK in WebPageProxy::loadRecentSearches() and WebPageProxy::saveRecentSearches()
<https://webkit.org/b/210683>
<rdar://problem/59240446>

Reviewed by Geoffrey Garen.

  • UIProcess/Cocoa/WebPageProxyCocoa.mm:

(MESSAGE_CHECK): Add.
(MESSAGE_CHECK_COMPLETION): Add.
(WebKit::WebPageProxy::saveRecentSearches):
(WebKit::WebPageProxy::loadRecentSearches):

  • Replace boolean check of const String& with MESSAGE_CHECK.
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r260334 r260347  
     12020-04-19  David Kilzer  <ddkilzer@apple.com>
     2
     3        [IPC hardening] Use MESSAGE_CHECK in WebPageProxy::loadRecentSearches() and WebPageProxy::saveRecentSearches()
     4        <https://webkit.org/b/210683>
     5        <rdar://problem/59240446>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
     10        (MESSAGE_CHECK): Add.
     11        (MESSAGE_CHECK_COMPLETION): Add.
     12        (WebKit::WebPageProxy::saveRecentSearches):
     13        (WebKit::WebPageProxy::loadRecentSearches):
     14        - Replace boolean check of const String& with MESSAGE_CHECK.
     15
    1162020-04-18  Darin Adler  <darin@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm

    r260182 r260347  
    11/*
    2  * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#import "APIAttachment.h"
    3030#import "APIUIClient.h"
     31#import "Connection.h"
    3132#import "DataDetectionResult.h"
    3233#import "InsertTextOptions.h"
     
    5556#endif
    5657
     58#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process().connection())
     59#define MESSAGE_CHECK_COMPLETION(assertion, completion) MESSAGE_CHECK_COMPLETION_BASE(assertion, process().connection(), completion)
     60
    5761namespace WebKit {
    5862using namespace WebCore;
     
    6771void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems)
    6872{
    69     if (!name) {
    70         // FIXME: This should be a message check.
    71         return;
    72     }
     73    MESSAGE_CHECK(!name.isNull());
    7374
    7475    WebCore::saveRecentSearches(name, searchItems);
     
    7778void WebPageProxy::loadRecentSearches(const String& name, CompletionHandler<void(Vector<WebCore::RecentSearch>&&)>&& completionHandler)
    7879{
    79     if (!name) {
    80         // FIXME: This should be a message check.
    81         return completionHandler({ });
    82     }
     80    MESSAGE_CHECK_COMPLETION(!name.isNull(), completionHandler({ }));
    8381
    8482    completionHandler(WebCore::loadRecentSearches(name));
     
    391389
    392390} // namespace WebKit
     391
     392#undef MESSAGE_CHECK_COMPLETION
     393#undef MESSAGE_CHECK
Note: See TracChangeset for help on using the changeset viewer.